<include file="nav:header"/>
<div class="container-fluid">
    <div class="row">
        <include file="Left:left-Common"/>
        <!-- right -->
        <div class="col-md-10 right">
            <div class="page-header" style="margin-right: 15px">
                <h3>{$page_title}</h3>
            </div>
            <form class="link" action="{:U('Link/savehend')}" method="post">
                <input name="id" type="hidden" value="{$link.id}">
                <div class="col-md-7">
                <div class="btn-group " role="group" aria-label="Large button group">
                    <a href="{:U('Link/index')}" type="button" class="btn btn-default">بارلىق دوستانە ئۇلىنىشلار</a>
                    <a href="{:U('Link/add')}" type="button" class="btn btn-default">دوستانە ئۇلىنىش قوشۇش</a>
                </div>
                <br><br>
                    <div class="form-group">
                        <input  name="name" type="text" class="form-control"   value="{$link.name}">
                    </div>
                    <br>
                    <div class="form-group">
                        <input  name="url" type="text" class="form-control" value="{$link.url}"   placeholder="  ئۇلانما ئادېرىسى:     http:// نى قوشۇپ يېزىڭ " />
                    </div>
                    <br>
                    <div class="form-group">
                        <input name="sort" type="number" class="form-control"  value="{$link.sort}">
                    </div>
                    <br>
                    <div class="btn-group checkbox">
                        <label class="btn btn-success btn-xs active" for="in1">
                            <input id="in1"  type="radio" name="status"  value="1" <if condition="$link.status">checked</if> > ئوچۇق
                        </label>
                        <label class="btn btn-danger btn-xs" for="in2">
                            <input id="in2"  type="radio" name="status" <if condition="$link.status eq 0">checked</if>  value="0"> تاقاق
                        </label>
                    </div>
                    <br><br>
                    <button style="width: 150px" type="submit" class="btn btn-primary">ساقلاش</button>
            </div>
                <div class="hidden-xs hidden-sm" style="height: 52px;"></div>
                <div class="col-md-4">
                    <div class="panel panel-default">
                        <div class="panel-heading" style="font-size: 15px">ئايلانما ئېلان رەسىم قوشۇش</div>
                        <div class="panel-body">
                            <button type="button" class="layui-btn pull-left" id="test1">
                                <i class="layui-icon"></i>رەسىم يوللاش
                            </button>
                            <input id="thumb" style="width: 70%"  name="thumb" class="form-control pull-right" value="{$link.thumb}" />
                            <br>
                            <img  id="thumbface" src="/{$link.thumb}" />
                        </div>
                        <script>
                            layui.use('upload', function(){
                                var upload = layui.upload;
                                //执行实例
                                var uploadInst = upload.render({
                                    elem: '#test1' //绑定元素
                                    ,url: '{:U("Link/upload")}' //上传接口
                                    ,done: function(res){
                                        //上传完毕回调
                                        if(res.status == 1){
                                            layer.alert(res.message, {
                                                title:"سېستىما ئەسكەرتىشى",
                                                btn:"بىلدىم",
                                                icon: 6,
                                                skin: 'layer-ext-moon',
                                                time:500
                                            });
                                            $("#thumb").val(res.src) ;
                                            $("#thumbface").css("display","block") ;
                                            $("#thumbface").attr("src","/"+res.src) ;
                                        }else{
                                            layer.alert(res.message, {
                                                title:"سېستىما ئەسكەرتىشى",
                                                btn:"بىلدىم",
                                                icon: 5,
                                                skin: 'layer-ext-moon',
                                                time:1000
                                            });
                                        }
                                    }
                                    ,error: function(){
                                        //请求异常回调
                                    }
                                });
                            });
                        </script>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<div class="visible-md visible-lg" style="height:200px;"></div>
<script type="text/javascript">
    //时间选择器
    jeDate({
        dateCell:"#DefineTime",
        format:"YYYY-MM-DD hh:mm:ss",
        isinitVal:true,
        isTime:true, //isClear:false,
        minDate:"2014-09-19 00:00:00",
        okfun:function(val){alert(val)}
    })
</script>
<include file="nav:footer"/>